﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace ShuntingScheduleUserControl
{
    public partial class Canvas : UserControl
    {
        public Canvas()
        {
            InitializeComponent();

            this.SetStyle(ControlStyles.AllPaintingInWmPaint, true);
            this.SetStyle(ControlStyles.UserPaint, true);
            this.SetStyle(ControlStyles.OptimizedDoubleBuffer, true);
        }

        /// <summary>
        /// 获取鼠标位置
        /// </summary>
        public LitMath.Vector2 GetMousePosition()
        {
            Point point = this.PointToClient(Control.MousePosition);
            return new LitMath.Vector2(point.X, point.Y);
        }
    }
}
